/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-09-17
 * Time: 21:18
 */
public class Rectangle {
    double width;
    double height;

    public void setRectangle( int w, int h) {
        if( w <= 0 || h<=0) {
            System.out.println("参数输入错误");
            return;
        }
        width = (double) w;
        height = (double) h;
    }

    public double getArea() {
        return width*height;
    }

}
